const arr = ['hello', 'world', 'index', NaN]

Array.prototype.my_indexOf = function(target) {

	for (let i = 0; i < this.length; i++) {
		if (this[i] == target) {
			return i
		}
		if (Number.isNaN(this[i])) {
			return i
		}
	}
	return -1
}
const res = arr.my_indexOf(NaN)
console.log(res);
